﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;


using System.Collections.Generic;

using System.Text;
using System.Collections;
using System.Data;
using Maticsoft.DBUtility;

using MySql.Data.MySqlClient;
using EnvironmentManagerSystem.MODE;
namespace EnvironmentManagerSystem.A
{
    public class FangFa
    {
        #region 获取环评类别名称(x)
        //public static DataTable GetHuanPingLeiBieMingCheng()
        //{
        //    try
        //    {
        //        string strSql = string.Format("SELECT id,DataValue AS NAME FROM tbs001_basicdatasub WHERE MainID = '7' ORDER BY id");
        //        return DbHelperMySQL.Query(strSql).Tables[0];
        //    }
        //    catch
        //    {
        //        return null;
        //    }
        //}
        #endregion
        #region MyRegion
        public static BasicDataSubDataCollection GetByIDs(string IDlist)
        {
            BasicDataSubDataCollection hs = new BasicDataSubDataCollection();
            try
            {
                string sql = @"SELECT id,DataValue FROM tbs001_basicdatasub WHERE MainID = 7 and DataValue IN (" + IDlist + ")";
                MySqlDataReader dr = DbHelperMySQL.ExecuteReader(sql);
                while (dr.Read())
                {
                    BasicDataSubData model = new BasicDataSubData();
                    if (dr[0] != DBNull.Value)
                        model.ID =Convert.ToInt32(dr[0]);
                    if (dr[1] != DBNull.Value)
                        model.DataValue = dr[1].ToString();
                    
                    hs.Add(model);
                }
                return hs;
            }
            catch
            {
                return null;
            }
        }
        #endregion
    }
}
